package com.starview.star.operators.arith;

import com.starview.platform.data.type.IType;
import com.starview.platform.data.type.StandardTypes;
import com.starview.platform.data.type.TypeUtils;
import com.starview.star.operators.Builtin;
import com.starview.star.operators.Intrinsics;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatAbs;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatCbrt;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatCeil;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatExp;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatFloor;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatLog;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatLog10;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatRandom;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatRound;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatSqrt;
import com.starview.star.operators.arith.runtime.FloatUnary.FloatUMinus;

public abstract class FloatUnary
{

  public static final String UMINUS = "__float_uminus";

  public static void declare(Intrinsics cxt)
  {
    IType floatType = StandardTypes.rawFloatType;
    IType type = TypeUtils.functionType(floatType, floatType);

    cxt.declareBuiltin(new Builtin("__float_abs", type, FloatAbs.class));
    cxt.declareBuiltin(new Builtin(UMINUS, type, FloatUMinus.class));
    cxt.declareBuiltin(new Builtin("__float_random", type, FloatRandom.class));
    cxt.declareBuiltin(new Builtin("__float_sqrt", type, FloatSqrt.class));
    cxt.declareBuiltin(new Builtin("__float_cbrt", type, FloatCbrt.class));
    cxt.declareBuiltin(new Builtin("__float_ceil", type, FloatCeil.class));
    cxt.declareBuiltin(new Builtin("__float_floor", type, FloatFloor.class));
    cxt.declareBuiltin(new Builtin("__float_round", type, FloatRound.class));
    cxt.declareBuiltin(new Builtin("__float_log", type, FloatLog.class));
    cxt.declareBuiltin(new Builtin("__float_log10", type, FloatLog10.class));
    cxt.declareBuiltin(new Builtin("__float_exp", type, FloatExp.class));
  }
}
